Integrand size = 31, antiderivative size = 99 \[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=\frac {4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac {4 i a^3 (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {i a^3 (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45} \[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=\frac {i a^3 (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac {4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac {4 i a^3 (c-i c \tan (e+f x))^{n+1}}{c f (n+1)} \]
[In]
[Out]
Rule 45
Rule 3568
Rule 3603
Rubi steps \begin{align*} \text {integral}& = \left (a^3 c^3\right ) \int \sec ^6(e+f x) (c-i c \tan (e+f x))^{-3+n} \, dx \\ & = \frac {\left (i a^3\right ) \text {Subst}\left (\int (c-x)^2 (c+x)^{-1+n} \, dx,x,-i c \tan (e+f x)\right )}{c^2 f} \\ & = \frac {\left (i a^3\right ) \text {Subst}\left (\int \left (4 c^2 (c+x)^{-1+n}-4 c (c+x)^n+(c+x)^{1+n}\right ) \, dx,x,-i c \tan (e+f x)\right )}{c^2 f} \\ & = \frac {4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac {4 i a^3 (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {i a^3 (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)} \\ \end{align*}
Time = 0.78 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.76 \[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=-\frac {i a^3 (c-i c \tan (e+f x))^n \left (-8-5 n-n^2-2 i n (3+n) \tan (e+f x)+n (1+n) \tan ^2(e+f x)\right )}{f n (1+n) (2+n)} \]
[In]
[Out]
Time = 2.10 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.30
method | result | size |
derivativedivides | \(\frac {i a^{3} \left (n^{2}+5 n +8\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) f n \left (2+n \right )}-\frac {i a^{3} \left (\tan ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (2+n \right )}-\frac {2 a^{3} \left (3+n \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right ) \left (2+n \right )}\) | \(129\) |
default | \(\frac {i a^{3} \left (n^{2}+5 n +8\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) f n \left (2+n \right )}-\frac {i a^{3} \left (\tan ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (2+n \right )}-\frac {2 a^{3} \left (3+n \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right ) \left (2+n \right )}\) | \(129\) |
norman | \(\frac {i a^{3} \left (n^{2}+5 n +8\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) f n \left (2+n \right )}-\frac {i a^{3} \left (\tan ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (2+n \right )}-\frac {2 a^{3} \left (3+n \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (1+n \right ) \left (2+n \right )}\) | \(129\) |
risch | \(\text {Expression too large to display}\) | \(947\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.52 \[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=-\frac {4 \, {\left (-2 i \, a^{3} + {\left (-i \, a^{3} n^{2} - 3 i \, a^{3} n - 2 i \, a^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (-i \, a^{3} n - 2 i \, a^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{3} + 3 \, f n^{2} + 2 \, f n + {\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 979 vs. \(2 (80) = 160\).
Time = 0.82 (sec) , antiderivative size = 979, normalized size of antiderivative = 9.89 \[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=\text {Too large to display} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 547 vs. \(2 (87) = 174\).
Time = 0.52 (sec) , antiderivative size = 547, normalized size of antiderivative = 5.53 \[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=\frac {2^{n + 3} a^{3} c^{n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - i \cdot 2^{n + 3} a^{3} c^{n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + 8 \, {\left (a^{3} c^{n} n + 2 \, a^{3} c^{n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + 4 \, {\left (a^{3} c^{n} n^{2} + 3 \, a^{3} c^{n} n + 2 \, a^{3} c^{n}\right )} 2^{n} \cos \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right ) + 8 \, {\left (-i \, a^{3} c^{n} n - 2 i \, a^{3} c^{n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + 4 \, {\left (-i \, a^{3} c^{n} n^{2} - 3 i \, a^{3} c^{n} n - 2 i \, a^{3} c^{n}\right )} 2^{n} \sin \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right )}{{\left ({\left (-i \, n^{3} - 3 i \, n^{2} - 2 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \cos \left (4 \, f x + 4 \, e\right ) + {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \sin \left (4 \, f x + 4 \, e\right ) + {\left (-i \, n^{3} - 3 i \, n^{2} - 2 \, {\left (i \, n^{3} + 3 i \, n^{2} + 2 i \, n\right )} \cos \left (2 \, f x + 2 \, e\right ) + 2 \, {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} \sin \left (2 \, f x + 2 \, e\right ) - 2 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n}\right )} f} \]
[In]
[Out]
\[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n} \,d x } \]
[In]
[Out]
Time = 1.61 (sec) , antiderivative size = 230, normalized size of antiderivative = 2.32 \[ \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx=\frac {2\,a^3\,{\left (\frac {c\,\left (\cos \left (2\,e+2\,f\,x\right )+1-\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}\right )}^n\,\left (n\,7{}\mathrm {i}+\cos \left (2\,e+2\,f\,x\right )\,16{}\mathrm {i}+\cos \left (4\,e+4\,f\,x\right )\,4{}\mathrm {i}-2\,n^2\,\sin \left (2\,e+2\,f\,x\right )-n^2\,\sin \left (4\,e+4\,f\,x\right )+n\,\cos \left (2\,e+2\,f\,x\right )\,10{}\mathrm {i}+n\,\cos \left (4\,e+4\,f\,x\right )\,3{}\mathrm {i}-6\,n\,\sin \left (2\,e+2\,f\,x\right )-3\,n\,\sin \left (4\,e+4\,f\,x\right )+n^2\,1{}\mathrm {i}+n^2\,\cos \left (2\,e+2\,f\,x\right )\,2{}\mathrm {i}+n^2\,\cos \left (4\,e+4\,f\,x\right )\,1{}\mathrm {i}+12{}\mathrm {i}\right )}{f\,n\,\left (4\,\cos \left (2\,e+2\,f\,x\right )+\cos \left (4\,e+4\,f\,x\right )+3\right )\,\left (n^2+3\,n+2\right )} \]
[In]
[Out]